package cn.edu.sdjzu.xg.kcsj.security;

import java.io.Serializable;
import java.util.Collection;

public class Role implements Comparable<Role>, Serializable {
    private int id;
    private String description;
    private Collection<Resource> resources;

    public Role(int id, String description, Collection<Resource> resources) {
        this.id = id;
        this.description = description;
        this.resources = resources;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Collection<Resource> getResources() {
        return resources;
    }

    public void setResources(Collection<Resource> resources) {
        this.resources = resources;
    }

    @Override
    public String toString() {
        return "Role{" +
                "id=" + id +
                ", description='" + description + '\'' +
                ", resources=" + resources +
                '}';
    }

    @Override
    public int compareTo(Role o) {
        return this.id - o.id;
    }
}
